import request from '@/utils/request'

const BASE_URL = '/system/permission'

export function getOne(id) {
  return request({
    url: BASE_URL + '/' + id,
    method: 'get'
  })
}

export function getList() {
  return request({
    url: BASE_URL,
    method: 'get'
  })
}

export function createOne(data) {
  return request({
    url: BASE_URL,
    method: 'post',
    data
  })
}

export function deleteById(id) {
  return request({
    url: BASE_URL + '/' + id,
    method: 'delete'
  })
}

export function deleteAll(data) {
  return request({
    url: BASE_URL,
    method: 'delete',
    data
  })
}

export function update(data) {
  return request({
    url: BASE_URL,
    method: 'put',
    data
  })
}

export function findByRoleId(id) {
  return request({
    url: BASE_URL + '/roleId/' + id,
    method: 'get'
  })
}

